﻿using System;
using System.Text;

namespace Browser
{
    class MD5
    {
        /// <summary>
        /// MD5加密字符串
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static string GetMD5(string text)
        {
            if (text == "")
            {
                return "";
            }

            System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            string cryptText = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(text)), 6, 8);
            return cryptText;
        }

    }
}
